//
// Created by luosong on 15/8/27.
// Copyright (c) 2015 CHANJET. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CSPNetworking.h"


@interface CSPRequestConfig : NSObject<NSCopying>

@property (nonatomic, readonly) NSURL *URL;
@property (nonatomic, strong) NSURL *baseURL;
@property (nonatomic, strong) NSString *URLString;
@property (nonatomic, assign) CSPHTTPMethod HTTPMethod;
@property (nonatomic, strong) NSDictionary *headers;
@property (nonatomic, strong) id<CSPURLRequestSerializer> requestSerializer;
@property (nonatomic, strong) NSArray *requestInterceptors; // Array of CSPRequestRequestInterceptor.
@property (nonatomic, strong) id<CSPHTTPURLResponseSerializer> responseSerializer;
@property (nonatomic, strong) NSArray *responseInterceptors; // Array of CSPRequestResponseInterceptor.
@property (nonatomic, strong) id<CSPRequestRetryHandler> retryHandler;

/**
The maximum number of retries for failed requests. The value needs to be between 0 and 10 inclusive. If set to higher than 10, it becomes 10.
*/
@property (nonatomic, assign) uint32_t maxRetryCount;

/**
The timeout interval to use when waiting for additional data.
*/
@property (nonatomic, assign) NSTimeInterval timeoutIntervalForRequest;

/**
The maximum amount of time that a resource request should be allowed to take.
*/
@property (nonatomic, assign) NSTimeInterval timeoutIntervalForResource;


@end